<?php
require_once 'Spreadsheet/Writer.php';

$workbook = new Spreadsheet_Excel_Writer();

$filename = date('YmdHis').'.xls';
$workbook->send($filename); // 发送 Excel 文件名供下载

$workbook->setVersion( 8 );
$workbook->setBIFF8InputEncoding('UTF-8');

$worksheet =& $workbook->addWorksheet("Sheet");

$data[]= array('id','username','company','email','mob','daytime','intent');

$data[] = array(1,'老李','和为贵工作室','psdshow@gmail.com','1363137966*',time(),'y');


$total_row = count($data);
$total_col = count($data[0]);
for ($row = 0; $row < $total_row; $row ++) {
   for ($col = 0; $col < $total_col; $col ++) {
		$worksheet->writeString($row, $col, $data[$row][$col]); // 在 sheet-1 中写入数据
   }
}
$workbook->close(); //完成下载
?>